package com.lyl.myaiagent.controller;

import com.lyl.myaiagent.app.PROApp;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @author lyl
 * @version 1.0
 * @CreateTime: 2025-08-19
 */
@Tag(name = "专家知识问答")
@RestController
@RequestMapping("/pro/ask")
public class ProAskController {

    @Resource
    private PROApp proApp;
    @GetMapping(value = "/simple_do_chat", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<String> simpleDoChat(String userPrompt, String chatId){
        return proApp.simpleDoChat(userPrompt,chatId);
    }

    @GetMapping(value = "/chat_with_local_Rag", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<String> chatWithLocalRag(String userPrompt, String chatId){
        return proApp.chatWithLocalRag(userPrompt,chatId);
    }

    @GetMapping(value = "/chat_with_cloud_Rag", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<String> chatWithCloudRag(String userPrompt, String chatId){
        return proApp.chatWithCloudRag(userPrompt,chatId);
    }

    @GetMapping(value = "/chat_with_tools_rag_base_pgvector", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<String> chatWithToolsAndRagBasePgVector(String userPrompt, String chatId){
        return proApp.chatWithToolsAndRagBasePgVector(userPrompt,chatId);
    }
}
